<!--
 * @Descripttion: 组件调用界面
 * @version: mmp
 * @Author: 自己洗小红花
 * @Date: 2019-10-25 10:20:12
 -->
<template>
  <div>
    <dynamicForm :formConfig="formConfig" v-model="jsonData" />
    <el-button @click="toBack">回填</el-button>
    <el-button @click="sub">提交</el-button>
  </div>
</template>
<script>
import dynamicForm from "@/components/dynamicForm/dynamicForm";
import apiHome from "@/httpUtils/apiHome";
export default {
  components: {
    dynamicForm
  },
  created() {
    apiHome.getdynamicFormData().then(res => {
      this.formConfig = res.data;
    });
  },
  mounted() {},
  data() {
    return {
      formConfig: {},
      jsonData: {}
    };
  },
  methods: {
    sub() {
      console.log("jsonData", this.jsonData);
    },
    toBack() {
      let obj = {
        gender: "1",
        name: "123",
        unit: ["a"]
      };
      this.jsonData = obj;
    }
  }
};
</script>
